import { _ as _export_sfc, m as mpMixin, a as mixin, c as createBlock, o as openBlock, w as withCtx, b as createVNode, i as index$g, n as normalizeStyle, r as renderSlot, d as createIntersectionObserver, e as createCommentVNode, f as normalizeClass, g as createElementBlock, F as Fragment, h as renderList, j as resolveEasycom, k as resolveDynamicComponent, S as Swiper, l as SwiperItem, p as index$q, q as index$d, s as index$i, t as createTextVNode, u as toDisplayString, v as createVideoContext, x as useMainStore, y as storeToRefs, z as ref, A as computed, B as onLoad, C as setNavigationBarColor, D as setNavigationBarTitle, E as setStorage, G as __easycom_0, H as unref, I as switchTab } from './index-Cc4oxzDN.js';
import { _ as __easycom_1$1 } from './uv-loading-icon.DuNkB54M.js';
import { _ as __easycom_3 } from './layout.FALqt04o.js';
import { m as menuAds } from './market.DCE5Fo51.js';

const props$2 = {
	props: {
		// 吸顶容器到顶部某个距离的时候，进行吸顶，在H5平台，NavigationBar为44px
		offsetTop: {
			type: [String, Number],
			default: 0
		},
		// 自定义导航栏的高度
		customNavHeight: {
			type: [String, Number],

			// H5端的导航栏属于“自定义”导航栏的范畴，因为它是非原生的，与普通元素一致
			default: 44,




		},
		// 是否禁用吸顶功能
		disabled: {
			type: Boolean,
			default: false
		},
		// 吸顶区域的背景颜色
		bgColor: {
			type: String,
			default: 'transparent'
		},
		// z-index值
		zIndex: {
			type: [String, Number],
			default: ''
		},
		// 列表中的索引值
		index: {
			type: [String, Number],
			default: ''
		},
		...uni.$uv?.props?.sticky
	}
};

/**
	 * sticky 吸顶
	 * @description 该组件与CSS中position: sticky属性实现的效果一致，当组件达到预设的到顶部距离时， 就会固定在指定位置，组件位置大于预设的顶部距离时，会重新按照正常的布局排列。
	 * @tutorial https://www.uvui.cn/components/sticky.html
	 * @property {String ｜ Number}	offsetTop		吸顶时与顶部的距离，单位px（默认 0 ）
	 * @property {String ｜ Number}	customNavHeight	自定义导航栏的高度 （h5 默认44  其他默认 0 ）
	 * @property {Boolean}			disabled		是否开启吸顶功能 （默认 false ）
	 * @property {String}			bgColor			组件背景颜色（默认 '#ffffff' ）
	 * @property {String ｜ Number}	zIndex			吸顶时的z-index值
	 * @property {String ｜ Number}	index			自定义标识，用于区分是哪一个组件
	 * @property {Object}			customStyle		组件的样式，对象形式
	 * @example <uv-sticky offsetTop="200"><view>塞下秋来风景异，衡阳雁去无留意</view></uv-sticky>
	 */
	const _sfc_main$3 = {
		name: 'uv-sticky',
		mixins: [mpMixin, mixin, props$2],
		data() {
			return {
				cssSticky: false, // 是否使用css的sticky实现
				stickyTop: 0, // 吸顶的top值，因为可能受自定义导航栏影响，最终的吸顶值非offsetTop值
				elId: '',
				left: 0, // js模式时，吸顶的内容因为处于postition: fixed模式，为了和原来保持一致的样式，需要记录并重新设置它的left，height，width属性
				width: 'auto',
				height: 'auto',
				fixed: false, // js模式时，是否处于吸顶模式
			}
		},
		computed: {
			style() {
				const style = {};
				if(!this.disabled) {
					if (this.cssSticky) {
						style.position = 'sticky';
						style.zIndex = this.uZindex;
						style.top = this.$uv.addUnit(this.stickyTop);
					} else {
						style.height = this.fixed ? this.height + 'px' : 'auto';
					}
				} else {
					// 无需吸顶时，设置会默认的relative(nvue)和非nvue的static静态模式即可




					style.position = 'static';

				}
				style.backgroundColor = this.bgColor;
				return this.$uv.deepMerge(this.$uv.addStyle(this.customStyle), style)
			},
			// 吸顶内容的样式
			stickyContent() {
				const style = {};
				if (!this.cssSticky) {
					style.position = this.fixed ? 'fixed' : 'static';
					style.top = this.stickyTop + 'px';
					style.left = this.left + 'px';
					style.width = this.width == 'auto' ? 'auto' : this.width + 'px';
					style.zIndex = this.uZindex;
				}
				return style
			},
			uZindex() {
				return this.zIndex ? this.zIndex : 970
			}
		},
		created() {
			this.elId = this.$uv.guid();
		},
		mounted() {
			this.init();
		},
		methods: {
			init() {
				this.getStickyTop();
				// 判断使用的模式
				this.checkSupportCssSticky();
				// 如果不支持css sticky，则使用js方案，此方案性能比不上css方案
				if (!this.cssSticky) {
					!this.disabled && this.initObserveContent();
				}
			},
			initObserveContent() {
				// 获取吸顶内容的高度，用于在js吸顶模式时，给父元素一个填充高度，防止"塌陷"
				this.$uvGetRect('#' + this.elId).then((res) => {
					this.height = res.height;
					this.left = res.left;
					this.width = res.width;
					this.$nextTick(() => {
						this.observeContent();
					});
				});
			},
			observeContent() {
				// 先断掉之前的观察
				this.disconnectObserver('contentObserver');
				const contentObserver = createIntersectionObserver({
					// 检测的区间范围
					thresholds: [0.95, 0.98, 1]
				});
				// 到屏幕顶部的高度时触发
				contentObserver.relativeToViewport({
					top: -this.stickyTop
				});
				// 绑定观察的元素
				contentObserver.observe(`#${this.elId}`, res => {
					this.setFixed(res.boundingClientRect.top);
				});
				this.contentObserver = contentObserver;
			},
			setFixed(top) {
				// 判断是否出于吸顶条件范围
				const fixed = top <= this.stickyTop;
				this.fixed = fixed;
			},
			disconnectObserver(observerName) {
				// 断掉观察，释放资源
				const observer = this[observerName];
				observer && observer.disconnect();
			},
			getStickyTop() {
				this.stickyTop = this.$uv.getPx(this.offsetTop) + this.$uv.getPx(this.customNavHeight);
			},
			async checkSupportCssSticky() {

				// H5，一般都是现代浏览器，是支持css sticky的，这里使用创建元素嗅探的形式判断
				if (this.checkCssStickyForH5()) {
					this.cssSticky = true;
				}


				// 如果安卓版本高于8.0，依然认为是支持css sticky的(因为安卓7在某些机型，可能不支持sticky)
				if (this.$uv.os() === 'android' && Number(this.$uv.sys().system) > 8) {
					this.cssSticky = true;
				}

				// APP-Vue和微信平台，通过computedStyle判断是否支持css sticky




				// ios上，从ios6开始，都是支持css sticky的
				if (this.$uv.os() === 'ios') {
					this.cssSticky = true;
				}

				// nvue，是支持css sticky的



			},
			// 在APP和微信小程序上，通过uni.createSelectorQuery可以判断是否支持css sticky
			checkComputedStyle() {
				// 方法内进行判断，避免在其他平台生成无用代码









			},
			// H5通过创建元素的形式嗅探是否支持css sticky
			// 判断浏览器是否支持sticky属性
			checkCssStickyForH5() {
				// 方法内进行判断，避免在其他平台生成无用代码

				const vendorList = ['', '-webkit-', '-ms-', '-moz-', '-o-'],
					vendorListLength = vendorList.length,
					stickyElement = document.createElement('div');
				for (let i = 0; i < vendorListLength; i++) {
					stickyElement.style.position = vendorList[i] + 'sticky';
					if (stickyElement.style.position !== '') {
						return true
					}
				}
				return false;

			}
		},






		unmounted() {
			this.disconnectObserver('contentObserver');
		}

	};

function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_v_uni_view = index$g;

  return (openBlock(), createBlock(_component_v_uni_view, {
    class: "uv-sticky",
    id: $data.elId,
    style: normalizeStyle([$options.style])
  }, {
    default: withCtx(() => [
      createVNode(_component_v_uni_view, {
        style: normalizeStyle([$options.stickyContent]),
        class: "uv-sticky__content"
      }, {
        default: withCtx(() => [
          renderSlot(_ctx.$slots, "default", {}, undefined, true)
        ]),
        _: 3
      }, 8, ["style"])
    ]),
    _: 3
  }, 8, ["id", "style"]))
}
const __easycom_1 = /*#__PURE__*/_export_sfc(_sfc_main$3, [['render',_sfc_render$2],['__scopeId',"data-v-df7be8db"]]);

const props$1 = {
	props: {
		// 轮播的长度
		length: {
			type: [String, Number],
			default: 0
		},
		// 当前处于活动状态的轮播的索引
		current: {
			type: [String, Number],
			default: 0
		},
		// 指示器非激活颜色
		indicatorActiveColor: {
			type: String,
			default: ''
		},
		// 指示器的激活颜色
		indicatorInactiveColor: {
			type: String,
			default: ''
		},
		// 指示器模式，line-线型，dot-点型
		indicatorMode: {
			type: String,
			default: ''
		},
		...uni.$uv?.props?.swiperIndicator
	}
};

/**
	 * SwiperIndicator 轮播图指示器
	 * @description 该组件一般用于导航轮播，广告展示等场景,可开箱即用，
	 * @tutorial https://www.uvui.cn/components/swiper.html
	 * @property {String | Number}	length					轮播的长度（默认 0 ）
	 * @property {String | Number}	current					当前处于活动状态的轮播的索引（默认 0 ）
	 * @property {String}			indicatorActiveColor	指示器非激活颜色
	 * @property {String}			indicatorInactiveColor	指示器的激活颜色
	 * @property {String}			indicatorMode			指示器模式（默认 'line' ）
	 * @example	<uv-swiper :list="list4" indicator keyName="url" :autoplay="false"></uv-swiper>
	 */
	const _sfc_main$2 = {
		name: 'uv-swiper-indicator',
		mixins: [mpMixin, mixin, props$1],
		data() {
			return {
				lineWidth: 22
			}
		},
		computed: {
			// 指示器为线型的样式
			lineStyle() {
				let style = {};
				style.width = this.$uv.addUnit(this.lineWidth);
				style.transform = `translateX(${ this.$uv.addUnit(this.current * this.lineWidth) })`;
				style.backgroundColor = this.indicatorActiveColor;
				return style
			},
			// 指示器为点型的样式
			dotStyle() {
				return index => {
					let style = {};
					style.backgroundColor = index === this.current ? this.indicatorActiveColor : this.indicatorInactiveColor;
					return style
				}
			}
		},
	};

function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_v_uni_view = index$g;

  return (openBlock(), createBlock(_component_v_uni_view, { class: "uv-swiper-indicator" }, {
    default: withCtx(() => [
      (_ctx.indicatorMode === 'line')
        ? (openBlock(), createBlock(_component_v_uni_view, {
            key: 0,
            class: normalizeClass(["uv-swiper-indicator__wrapper", [`uv-swiper-indicator__wrapper--${_ctx.indicatorMode}`]]),
            style: normalizeStyle({
				width: _ctx.$uv.addUnit($data.lineWidth * _ctx.length),
				backgroundColor: _ctx.indicatorInactiveColor
			})
          }, {
            default: withCtx(() => [
              createVNode(_component_v_uni_view, {
                class: "uv-swiper-indicator__wrapper--line__bar",
                style: normalizeStyle([$options.lineStyle])
              }, null, 8, ["style"])
            ]),
            _: 1
          }, 8, ["class", "style"]))
        : createCommentVNode("", true),
      (_ctx.indicatorMode === 'dot')
        ? (openBlock(), createBlock(_component_v_uni_view, {
            key: 1,
            class: "uv-swiper-indicator__wrapper"
          }, {
            default: withCtx(() => [
              (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.length, (item, index) => {
                return (openBlock(), createBlock(_component_v_uni_view, {
                  class: normalizeClass(["uv-swiper-indicator__wrapper__dot", [index === _ctx.current && 'uv-swiper-indicator__wrapper__dot--active']]),
                  key: index,
                  style: normalizeStyle([$options.dotStyle(index)])
                }, null, 8, ["class", "style"]))
              }), 128))
            ]),
            _: 1
          }))
        : createCommentVNode("", true)
    ]),
    _: 1
  }))
}
const __easycom_7 = /*#__PURE__*/_export_sfc(_sfc_main$2, [['render',_sfc_render$1],['__scopeId',"data-v-abf29ab9"]]);

const props = {
	props: {
		// 列表数组，元素可为字符串，如为对象可通过keyName指定目标属性名
		list: {
			type: Array,
			default: () => []
		},
		// 是否显示面板指示器
		indicator: {
			type: Boolean,
			default: false
		},
		// 指示器非激活颜色
		indicatorActiveColor: {
			type: String,
			default: '#fff'
		},
		// 指示器的激活颜色
		indicatorInactiveColor: {
			type: String,
			default: 'rgba(255, 255, 255, 0.35)'
		},
		// 指示器样式，可通过bottom，left，right进行定位
		indicatorStyle: {
			type: [String, Object],
			default: ''
		},
		// 指示器模式，line-线型，dot-点型
		indicatorMode: {
			type: String,
			default: 'line'
		},
		// 是否自动切换
		autoplay: {
			type: Boolean,
			default: true
		},
		// 当前所在滑块的 index
		current: {
			type: [String, Number],
			default: 0
		},
		// 当前所在滑块的 item-id ，不能与 current 被同时指定
		currentItemId: {
			type: String,
			default: ''
		},
		// 滑块自动切换时间间隔
		interval: {
			type: [String, Number],
			default: 3000
		},
		// 滑块切换过程所需时间
		duration: {
			type: [String, Number],
			default: 300
		},
		// 播放到末尾后是否重新回到开头
		circular: {
			type: Boolean,
			default: false
		},
		// 滑动方向是否为纵向
		vertical: {
			type: Boolean,
			default: false
		},
		// 前边距，可用于露出前一项的一小部分，nvue和支付宝不支持
		previousMargin: {
			type: [String, Number],
			default: 0
		},
		// 后边距，可用于露出后一项的一小部分，nvue和支付宝不支持
		nextMargin: {
			type: [String, Number],
			default: 0
		},
		// 当开启时，会根据滑动速度，连续滑动多屏，支付宝不支持
		acceleration: {
			type: Boolean,
			default: false
		},
		// 同时显示的滑块数量，nvue、支付宝小程序不支持
		displayMultipleItems: {
			type: Number,
			default: 1
		},
		// 指定swiper切换缓动动画类型，有效值：default、linear、easeInCubic、easeOutCubic、easeInOutCubic
		// 只对微信小程序有效
		easingFunction: {
			type: String,
			default: 'default'
		},
		// list数组中指定对象的目标属性名
		keyName: {
			type: String,
			default: 'url'
		},
		// 图片的裁剪模式
		imgMode: {
			type: String,
			default: 'aspectFill'
		},
		// 组件高度
		height: {
			type: [String, Number],
			default: 130
		},
		// 背景颜色
		bgColor: {
			type: String,
			default: '#f3f4f6'
		},
		// 组件圆角，数值或带单位的字符串
		radius: {
			type: [String, Number],
			default: 4
		},
		// 是否加载中
		loading: {
			type: Boolean,
			default: false
		},
		// 是否显示标题，要求数组对象中有title属性
		showTitle: {
			type: Boolean,
			default: false
		},
		// 显示的标题样式
		titleStyle: {
			type: [Object, String],
			default: ''
		},
		...uni.$uv?.props?.swiper
	}
};

/**
	 * Swiper 轮播图
	 * @description 该组件一般用于导航轮播，广告展示等场景,可开箱即用，
	 * @tutorial https://www.uvui.cn/components/swiper.html
	 * @property {Array}			list					轮播图数据
	 * @property {Boolean}			indicator				是否显示面板指示器（默认 false ）
	 * @property {String}			indicatorActiveColor	指示器非激活颜色（默认 '#FFFFFF' ）
	 * @property {String}			indicatorInactiveColor	指示器的激活颜色（默认 'rgba(255, 255, 255, 0.35)' ）
	 * @property {String | Object}	indicatorStyle			指示器样式，可通过bottom，left，right进行定位
	 * @property {String}			indicatorMode			指示器模式（默认 'line' ）
	 * @property {Boolean}			autoplay				是否自动切换（默认 true ）
	 * @property {String | Number}	current					当前所在滑块的 index（默认 0 ）
	 * @property {String}			currentItemId			当前所在滑块的 item-id ，不能与 current 被同时指定
	 * @property {String | Number}	interval				滑块自动切换时间间隔（ms）（默认 3000 ）
	 * @property {String | Number}	duration				滑块切换过程所需时间（ms）（默认 300 ）
	 * @property {Boolean}			circular				播放到末尾后是否重新回到开头（默认 false ）
	 * @property {String | Number}	previousMargin			前边距，可用于露出前一项的一小部分，nvue和支付宝不支持（默认 0 ）
	 * @property {String | Number}	nextMargin				后边距，可用于露出后一项的一小部分，nvue和支付宝不支持（默认 0 ）
	 * @property {Boolean}			acceleration			当开启时，会根据滑动速度，连续滑动多屏，支付宝不支持（默认 false ）
	 * @property {Number}			displayMultipleItems	同时显示的滑块数量，nvue、支付宝小程序不支持（默认 1 ）
	 * @property {String}			easingFunction			指定swiper切换缓动动画类型， 只对微信小程序有效（默认 'default' ）
	 * @property {String}			keyName					list数组中指定对象的目标属性名（默认 'url' ）
	 * @property {String}			imgMode					图片的裁剪模式（默认 'aspectFill' ）
	 * @property {String | Number}	height					组件高度（默认 130 ）
	 * @property {String}			bgColor					背景颜色（默认 	'#f3f4f6' ）
	 * @property {String | Number}	radius					组件圆角，数值或带单位的字符串（默认 4 ）
	 * @property {Boolean}			loading					是否加载中（默认 false ）
	 * @property {Boolean}			showTitle				是否显示标题，要求数组对象中有title属性（默认 false ）
	 * @event {Function(index)}	click	点击轮播图时触发	index：点击了第几张图片，从0开始
	 * @event {Function(index)}	change	轮播图切换时触发(自动或者手动切换)	index：切换到了第几张图片，从0开始
	 * @example	<uv-swiper :list="list4" keyName="url" :autoplay="false"></uv-swiper>
	 */
	const _sfc_main$1 = {
		name: 'uv-swiper',
		mixins: [mpMixin, mixin, props],
		emits: ['click','change'],
		data() {
			return {
				currentIndex: 0
			}
		},
		watch: {
			current(val, preVal) {
				if(val === preVal) return;
				this.currentIndex = val; // 和上游数据关联上
			}
		},
		computed: {
			itemStyle() {
				return index => {
					const style = {};

					// 左右流出空间的写法不支持nvue和头条
					// 只有配置了此二值，才加上对应的圆角，以及缩放
					if (this.nextMargin && this.previousMargin) {
						style.borderRadius = this.$uv.addUnit(this.radius);
						if (index !== this.currentIndex) style.transform = 'scale(0.92)';
					}

					return style
				}
			}
		},
		methods: {
      getItemType(item) {
        if (typeof item === 'string') return this.$uv.test.video(this.getSource(item)) ? 'video' : 'image'
        if (typeof item === 'object' && this.keyName) {
          if (!item.type) return this.$uv.test.video(this.getSource(item)) ? 'video' : 'image'
          if (item.type === 'image') return 'image'
          if (item.type === 'video') return 'video'
          return 'image'
        }
      },
			// 获取目标路径，可能数组中为字符串，对象的形式，额外可指定对象的目标属性名keyName
			getSource(item) {
				if (typeof item === 'string') return item
				if (typeof item === 'object' && this.keyName) return item[this.keyName]
				else this.$uv.error('请按格式传递列表参数');
				return ''
			},
			// 轮播切换事件
			change(e) {
				// 当前的激活索引
				const {
					current
				} = e.detail;
				this.pauseVideo(this.currentIndex);
				this.currentIndex = current;
				this.$emit('change', e.detail);
			},
			// 切换轮播时，暂停视频播放
			pauseVideo(index) {
				const lastItem = this.getSource(this.list[index]);
				if (this.$uv.test.video(lastItem)) {
					// 当视频隐藏时，暂停播放
					const video = createVideoContext(`video-${index}`, this);
					video.pause();
				}
			},
			// 当一个轮播item为视频时，获取它的视频海报
			getPoster(item) {
				return typeof item === 'object' && item.poster ? item.poster : ''
			},
			// 点击某个item
			clickHandler(index) {
				this.$emit('click', index);
			}
		},
	};

function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_uv_loading_icon = resolveEasycom(resolveDynamicComponent("uv-loading-icon"), __easycom_1$1);
  const _component_v_uni_view = index$g;
  const _component_v_uni_image = index$q;
  const _component_v_uni_video = index$d;
  const _component_v_uni_text = index$i;
  const _component_v_uni_swiper_item = SwiperItem;
  const _component_v_uni_swiper = Swiper;
  const _component_uv_swiper_indicator = resolveEasycom(resolveDynamicComponent("uv-swiper-indicator"), __easycom_7);

  return (openBlock(), createBlock(_component_v_uni_view, {
    class: "uv-swiper",
    style: normalizeStyle({
			backgroundColor: _ctx.bgColor,
			height: _ctx.$uv.addUnit(_ctx.height),
			borderRadius: _ctx.$uv.addUnit(_ctx.radius)
		})
  }, {
    default: withCtx(() => [
      (_ctx.loading)
        ? (openBlock(), createBlock(_component_v_uni_view, {
            key: 0,
            class: "uv-swiper__loading"
          }, {
            default: withCtx(() => [
              createVNode(_component_uv_loading_icon, { mode: "circle" })
            ]),
            _: 1
          }))
        : (openBlock(), createBlock(_component_v_uni_swiper, {
            key: 1,
            class: "uv-swiper__wrapper",
            style: normalizeStyle({
				height: _ctx.$uv.addUnit(_ctx.height),
				flex: 1
			}),
            onChange: $options.change,
            circular: _ctx.circular,
            vertical: _ctx.vertical,
            interval: _ctx.interval,
            duration: _ctx.duration,
            autoplay: _ctx.autoplay,
            current: _ctx.current,
            currentItemId: _ctx.currentItemId,
            previousMargin: _ctx.$uv.addUnit(_ctx.previousMargin),
            nextMargin: _ctx.$uv.addUnit(_ctx.nextMargin),
            acceleration: _ctx.acceleration,
            displayMultipleItems: _ctx.displayMultipleItems,
            easingFunction: _ctx.easingFunction
          }, {
            default: withCtx(() => [
              (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.list, (item, index) => {
                return (openBlock(), createBlock(_component_v_uni_swiper_item, {
                  class: "uv-swiper__wrapper__item",
                  key: index
                }, {
                  default: withCtx(() => [
                    createVNode(_component_v_uni_view, {
                      class: "uv-swiper__wrapper__item__wrapper",
                      style: normalizeStyle([$options.itemStyle(index)])
                    }, {
                      default: withCtx(() => [
                        ($options.getItemType(item) === 'image')
                          ? (openBlock(), createBlock(_component_v_uni_image, {
                              key: 0,
                              class: "uv-swiper__wrapper__item__wrapper__image",
                              src: $options.getSource(item),
                              mode: _ctx.imgMode,
                              onClick: $event => ($options.clickHandler(index)),
                              style: normalizeStyle({
							height: _ctx.$uv.addUnit(_ctx.height),
							borderRadius: _ctx.$uv.addUnit(_ctx.radius)
						})
                            }, null, 8, ["src", "mode", "onClick", "style"]))
                          : createCommentVNode("", true),
                        ($options.getItemType(item) === 'video')
                          ? (openBlock(), createBlock(_component_v_uni_video, {
                              key: 1,
                              class: "uv-swiper__wrapper__item__wrapper__video",
                              id: `video-${index}`,
                              "enable-progress-gesture": false,
                              src: $options.getSource(item),
                              poster: $options.getPoster(item),
                              title: _ctx.showTitle && _ctx.$uv.test.object(item) && item.title ? item.title : '',
                              style: normalizeStyle({
							height: _ctx.$uv.addUnit(_ctx.height)
						}),
                              controls: "",
                              onClick: $event => ($options.clickHandler(index))
                            }, null, 8, ["id", "src", "poster", "title", "style", "onClick"]))
                          : createCommentVNode("", true),
                        (_ctx.showTitle && _ctx.$uv.test.object(item) && item.title)
                          ? (openBlock(), createBlock(_component_v_uni_text, {
                              key: 2,
                              class: "uv-swiper__wrapper__item__wrapper__title uv-line-1",
                              style: normalizeStyle([_ctx.$uv.addStyle(_ctx.titleStyle)])
                            }, {
                              default: withCtx(() => [
                                createTextVNode(toDisplayString(item.title), 1)
                              ]),
                              _: 2
                            }, 1032, ["style"]))
                          : createCommentVNode("", true)
                      ]),
                      _: 2
                    }, 1032, ["style"])
                  ]),
                  _: 2
                }, 1024))
              }), 128))
            ]),
            _: 1
          }, 8, ["style", "onChange", "circular", "vertical", "interval", "duration", "autoplay", "current", "currentItemId", "previousMargin", "nextMargin", "acceleration", "displayMultipleItems", "easingFunction"])),
      createVNode(_component_v_uni_view, {
        class: "uv-swiper__indicator",
        style: normalizeStyle([_ctx.$uv.addStyle(_ctx.indicatorStyle)])
      }, {
        default: withCtx(() => [
          renderSlot(_ctx.$slots, "indicator", {}, () => [
            (!_ctx.loading && _ctx.indicator && !_ctx.showTitle)
              ? (openBlock(), createBlock(_component_uv_swiper_indicator, {
                  key: 0,
                  indicatorActiveColor: _ctx.indicatorActiveColor,
                  indicatorInactiveColor: _ctx.indicatorInactiveColor,
                  length: _ctx.list.length,
                  current: $data.currentIndex,
                  indicatorMode: _ctx.indicatorMode
                }, null, 8, ["indicatorActiveColor", "indicatorInactiveColor", "length", "current", "indicatorMode"]))
              : createCommentVNode("", true)
          ], true)
        ]),
        _: 3
      }, 8, ["style"])
    ]),
    _: 3
  }, 8, ["style"]))
}
const __easycom_2 = /*#__PURE__*/_export_sfc(_sfc_main$1, [['render',_sfc_render],['__scopeId',"data-v-401e3eb9"]]);

const _imports_0 = "/h5/static/images/take_in.png";

const _imports_1 = "/h5/static/images/take_out.png";

const _imports_2 = "/h5/static/images/franchisees.png";

const _imports_3 = "/h5/static/images/counter_ordering.png";

//

const __default__ = {
  onLoad() {
    // 设置导航栏透明化，仅设置背景色
    setNavigationBarColor({
      frontColor: '#ffffff', // 前景颜色（状态栏、标题等）
      backgroundColor: '#00000000' // 背景色透明
    });

    // 设置导航栏标题为空
    setNavigationBarTitle({
      title: ' '
    });
  }
};


const _sfc_main = /*#__PURE__*/Object.assign(__default__, {
  __name: 'index',
  setup(__props) {

const main = useMainStore();
const {
    member,
    store,
    isLogin,
    accesses
} = storeToRefs(main);
//const store = ref(main.store)
const listAds = ref([]);
// const isLogin = ref(main.isLogin)





// 计算intro的样式
const introStyle = computed(() => {





    

    return {}

});
const handGetListAds = async () => {
    let shop_id = store.id ? store.id : 0;
    let data = await menuAds({
        shop_id: shop_id
    });
    if (data) {
        listAds.value = data.list;
        console.log('listAds:', listAds.value);
		console.log('accesses:' , accesses.value);
        setStorage({
            key: 'isActive',
            data: data.isActive
        });
        if (data.list.length > 0) {
            setStorage({
                key: 'shopAd',
                data: data.list[0].image
            });
        }
    }
};
const takein = () => {
    main.SET_ORDER_TYPE('takein');
    switchTab({
        url: '/pages/menu/menu'
    });
};

const takeout = () => {
    main.SET_ORDER_TYPE('takeout');
    switchTab({
        url: '/pages/menu/menu'
    });
};

// 柜台点餐
const counter_ordering = () => {
    main.SET_ORDER_TYPE('counter_ordering');
    switchTab({
        url: '/pages/menu/menu'
    });
};

const franchisees = () => {
    main.SET_ORDER_TYPE('franchisees');
    switchTab({
        url: '/pages/menu/menu'
    });
};

onLoad(() => {
    // main.init()
    handGetListAds();
    console.log('accesses :=>', accesses.value);
    








});

return (_ctx, _cache) => {
  const _component_uv_navbar = resolveEasycom(resolveDynamicComponent("uv-navbar"), __easycom_0);
  const _component_uv_sticky = resolveEasycom(resolveDynamicComponent("uv-sticky"), __easycom_1);
  const _component_uv_swiper = resolveEasycom(resolveDynamicComponent("uv-swiper"), __easycom_2);
  const _component_v_uni_view = index$g;
  const _component_v_uni_image = index$q;
  const _component_layout = resolveEasycom(resolveDynamicComponent("layout"), __easycom_3);

  return (openBlock(), createBlock(_component_layout, null, {
    default: withCtx(() => [
      createVNode(_component_uv_sticky, {
        "bg-color": "#F5F5F5",
        "offset-top": "0",
        customNavHeight: "0"
      }, {
        default: withCtx(() => [
          createVNode(_component_uv_navbar, {
            fixed: true,
            safeAreaInsetTop: true,
            height: "0",
            bgColor: "transparent",
            leftIcon: ""
          })
        ]),
        _: 1
      }),
      createVNode(_component_v_uni_view, { class: "container" }, {
        default: withCtx(() => [
          createVNode(_component_v_uni_view, { class: "banner" }, {
            default: withCtx(() => [
              createVNode(_component_uv_swiper, {
                class: "bg",
                height: "225",
                imgMode: "aspectFill",
                keyName: "image",
                list: listAds.value,
                indicatorMode: "dot",
                indicatorStyle: "bottom"
              }, null, 8, ["list"]),
              createVNode(_component_v_uni_view, {
                class: "intro",
                style: normalizeStyle(introStyle.value)
              }, {
                default: withCtx(() => [
                  createVNode(_component_v_uni_view, { class: "greet" }, {
                    default: withCtx(() => [
                      createTextVNode("您好，" + toDisplayString(unref(isLogin) ? unref(member).nickname : '游客'), 1)
                    ]),
                    _: 1
                  }),
                  createVNode(_component_v_uni_view, { class: "note" }, {
                    default: withCtx(() => [
                      createTextVNode("周文斌点餐外卖系统")
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              }, 8, ["style"])
            ]),
            _: 1
          }),
          createVNode(_component_v_uni_view, { class: "content" }, {
            default: withCtx(() => [
              createVNode(_component_v_uni_view, { class: "entrance" }, {
                default: withCtx(() => [
                  createVNode(_component_v_uni_view, {
                    class: "item",
                    onClick: takein
                  }, {
                    default: withCtx(() => [
                      createVNode(_component_v_uni_view, { class: "index-title" }, {
                        default: withCtx(() => [
                          createVNode(_component_v_uni_view, { class: "font-md" }, {
                            default: withCtx(() => [
                              createTextVNode("堂食")
                            ]),
                            _: 1
                          }),
                          createVNode(_component_v_uni_view, { class: "font-small text-light-black flex-1" }, {
                            default: withCtx(() => [
                              createTextVNode("下单免排队")
                            ]),
                            _: 1
                          })
                        ]),
                        _: 1
                      }),
                      createVNode(_component_v_uni_view, { class: "index-img" }, {
                        default: withCtx(() => [
                          createVNode(_component_v_uni_image, {
                            src: _imports_0,
                            mode: "aspectFit",
                            class: "img-01"
                          })
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  }),
                  createVNode(_component_v_uni_view, {
                    class: "item",
                    onClick: takeout
                  }, {
                    default: withCtx(() => [
                      createVNode(_component_v_uni_view, null, {
                        default: withCtx(() => [
                          createVNode(_component_v_uni_view, { class: "font-md" }, {
                            default: withCtx(() => [
                              createTextVNode("外卖")
                            ]),
                            _: 1
                          }),
                          createVNode(_component_v_uni_view, { class: "font-small text-light-black" }, {
                            default: withCtx(() => [
                              createTextVNode("美食送到家")
                            ]),
                            _: 1
                          })
                        ]),
                        _: 1
                      }),
                      createVNode(_component_v_uni_view, { class: "index-img" }, {
                        default: withCtx(() => [
                          createVNode(_component_v_uni_image, {
                            src: _imports_1,
                            mode: "aspectFit",
                            class: "img-01"
                          })
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  }),
                  (unref(accesses)?.indexOf('user_franchisee') > -1 || false)
                    ? (openBlock(), createBlock(_component_v_uni_view, {
                        key: 0,
                        class: "item",
                        onClick: franchisees
                      }, {
                        default: withCtx(() => [
                          createVNode(_component_v_uni_view, null, {
                            default: withCtx(() => [
                              createVNode(_component_v_uni_view, { class: "font-md" }, {
                                default: withCtx(() => [
                                  createTextVNode("加盟商")
                                ]),
                                _: 1
                              }),
                              createVNode(_component_v_uni_view, { class: "font-small text-light-black flex-1" }, {
                                default: withCtx(() => [
                                  createTextVNode("加盟商")
                                ]),
                                _: 1
                              })
                            ]),
                            _: 1
                          }),
                          createVNode(_component_v_uni_view, { class: "index-img" }, {
                            default: withCtx(() => [
                              createVNode(_component_v_uni_image, {
                                src: _imports_2,
                                mode: "aspectFit",
                                class: "img-01"
                              })
                            ]),
                            _: 1
                          })
                        ]),
                        _: 1
                      }))
                    : createCommentVNode("", true),
                  (unref(accesses)?.indexOf('user_shopkeeper') > -1 || false)
                    ? (openBlock(), createBlock(_component_v_uni_view, {
                        key: 1,
                        class: "item",
                        onClick: counter_ordering
                      }, {
                        default: withCtx(() => [
                          createVNode(_component_v_uni_view, null, {
                            default: withCtx(() => [
                              createVNode(_component_v_uni_view, { class: "font-md" }, {
                                default: withCtx(() => [
                                  createTextVNode("餐单")
                                ]),
                                _: 1
                              }),
                              createVNode(_component_v_uni_view, { class: "font-small text-light-black flex-1" }, {
                                default: withCtx(() => [
                                  createTextVNode("柜台餐单")
                                ]),
                                _: 1
                              })
                            ]),
                            _: 1
                          }),
                          createVNode(_component_v_uni_view, { class: "index-img" }, {
                            default: withCtx(() => [
                              createVNode(_component_v_uni_image, {
                                src: _imports_3,
                                mode: "aspectFit",
                                class: "img-01"
                              })
                            ]),
                            _: 1
                          })
                        ]),
                        _: 1
                      }))
                    : createCommentVNode("", true)
                ]),
                _: 1
              })
            ]),
            _: 1
          })
        ]),
        _: 1
      })
    ]),
    _: 1
  }))
}
}

});
const index = /*#__PURE__*/_export_sfc(_sfc_main, [['__scopeId',"data-v-385de6c2"]]);

export { index as default };
